package com.cbg.discount.controller;
import com.cbg.base.core.SuperController;
import com.cbg.base.utils.Result;
import com.cbg.discount.entity.DiscountRecord;
import com.cbg.discount.service.IDiscountRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/discount/record")
public class DiscountRecordController extends SuperController<IDiscountRecordService, DiscountRecord> {
    @Autowired
    IDiscountRecordService iDiscountRecordService;

    /**
     * 发送优惠券
     * @param userId
     * @param discountId
     * @param channelId
     * @param amount
     * @return
     */
    @PostMapping("/send")
    public Result send( String userId, String discountId, String channelId, int amount){
        iDiscountRecordService.send(userId,discountId,channelId,amount);
        return Result.ok();
    }
}
